package com.tfb.boot;

import com.tfb.boot.bean.Cat;
import com.tfb.boot.bean.Dog;
import com.tfb.boot.bean.User;
import com.tfb.boot.serverlet.Myserverlet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class MainApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(MainApplication.class, args);

        User user = run.getBean("user", User.class);
        User user01 = run.getBean("user", User.class);
        Cat cat = run.getBean("cat", Cat.class);
        System.out.println("user=user01?"+(user==user01));
        System.out.println(user.getCat()==cat);
        String[] beanNamesForType = run.getBeanNamesForType(Dog.class);
        for (String s : beanNamesForType) {
            System.out.println(s);
        }
        Myserverlet myserverlet = new Myserverlet();

    }
}
